#coding utf-8

from Util import *

p0 = Point(1,1,0)
p1 = Point(2,2,1)
p2 = Point(30,30,2)
p3 = Point(31,31,3)
p4 = Point(33,33,4)
p5 = Point(42,42,5)

f = [p0,p1,p2,p3,p4,p5]


def teste():

	acumulador = 0
	for i in range( 1,len(f) ):
		p = f[i+acumulador]
		p_1 = f[i+acumulador-1]
		
		
		p.index+=acumulador
		
		dist = p.distance(p_1)
		
		if dist>10:
			novo_p = Point(p_1.x+dist/2,p_1.y+dist/2,p.index)
			f.insert(p.index,novo_p)
			
			acumulador+=1
			p.index+=1
					
		
	for p in f:
		print (p.x,p.y)
	
	for p in f:
		print p.index
		
teste()
